1 Preparations and Data

1.0 Required Packages

library(dplyr)

Attaching package: 'dplyr'
The following objects are masked from 'package:stats':

    filter, lag
The following objects are masked from 'package:base':

    intersect, setdiff, setequal, union
library(Seurat)
library(ggplot2)
library(scales)
library(mixtools)
mixtools package, version 1.2.0, Released 2020-02-05
This package is based upon work supported by the National Science Foundation under Grant No. SES-0518772.
library(mclust)
Package 'mclust' version 5.4.6
Type 'citation("mclust")' for citing this R package in publications.

Attaching package: 'mclust'
The following object is masked from 'package:mixtools':

    dmvnorm
packageVersion("dplyr")
[1] '0.8.99.9003'
packageVersion("Seurat")
[1] '3.1.5'
Pat1_HL60 <- readRDS(file ="./Pat1_HL60_CITE.rds")
DefaultAssay(Pat1_HL60 )<- "RNA"

2 Remove Cellline and cells similiar to cell line

VlnPlot(Pat1_HL60, assay= "HTO",features = c("Pat1-R1-H1","Pat1-Ven-R1-H2", "HL60-R1-H3"), ncol = 2, pt.size = 0.1, group.by = "RNA_cluster") + NoLegend()

DimPlot(Pat1_HL60, label = TRUE, label.size = 10, reduction  = "umap", group.by = "RNA_cluster") + NoLegend()
Warning: Using `as.character()` on a quosure is deprecated as of rlang 0.3.0.
Please use `as_label()` or `as_name()` instead.
This warning is displayed once per session.

Pat1_CITE.c <- subset(Pat1_HL60, subset = `hto_HL60-R1-H3` < 1.5)
Pat1_CITE.c <- subset(Pat1_CITE.c, subset = RNA_cluster != 4 & RNA_cluster != 6 & RNA_cluster != 9)
VlnPlot(Pat1_CITE.c, assay= "HTO",features = c("HL60-R1-H3"), ncol = 1, pt.size = 0.1, group.by = "RNA_cluster") + NoLegend()

Pat1_CITE.c
An object of class Seurat 
19524 features across 5364 samples within 3 assays 
Active assay: RNA (19510 features, 2000 variable features)
 2 other assays present: HTO, Epi
 5 dimensional reductions calculated: pca, umap, pca_epi, tsne_epi, umap_epi

Demultiplexing S01_CITE and S01_CITE_Ven

FeatureScatter(Pat1_CITE.c, feature1 = "hto_Pat1-R1-H1", feature2 = "hto_Pat1-Ven-R1-H2") + stat_function(fun=function(x)(1/4* exp (2*x)) -0.2 )  + stat_function(fun=function(x)(1/2*log (4*x) ) ) + ylim(0,4) + xlim(0,4)
Warning: Removed 23 rows containing missing values (geom_point).
Warning: Removed 65 row(s) containing missing values (geom_path).

Pat1_CITE.c[["H1.H2"]]<- Pat1_CITE.c@assays$HTO@data["Pat1-R1-H1",]-Pat1_CITE.c@assays$HTO@data["Pat1-Ven-R1-H2",]
VlnPlot(Pat1_CITE.c, features = c("H1.H2"), group.by = "orig.ident")+ geom_hline(yintercept=0.2) 

mixmdl <- Mclust(t(Pat1_CITE.c@assays$HTO@data[c("Pat1-R1-H1","Pat1-Ven-R1-H2"),]), G = 2)
summary(mixmdl, parameters = TRUE)
---------------------------------------------------- 
Gaussian finite mixture model fitted by EM algorithm 
---------------------------------------------------- 

Mclust VVV (ellipsoidal, varying volume, shape, and orientation) model with 2
components: 

 log-likelihood    n df       BIC       ICL
      -6826.522 5364 11 -13747.51 -14305.95

Clustering table:
   1    2 
2781 2583 

Mixing probabilities:
        1         2 
0.4932864 0.5067136 

Means:
                    [,1]      [,2]
Pat1-R1-H1     0.4613017 1.2148829
Pat1-Ven-R1-H2 0.9045152 0.8719508

Variances:
[,,1]
                Pat1-R1-H1 Pat1-Ven-R1-H2
Pat1-R1-H1     0.008072300    0.008268123
Pat1-Ven-R1-H2 0.008268123    0.060042503
[,,2]
               Pat1-R1-H1 Pat1-Ven-R1-H2
Pat1-R1-H1      0.6492458     -0.1631349
Pat1-Ven-R1-H2 -0.1631349      0.7292268
plot(mixmdl, what= "classification") 

mixmd2 <- normalmixEM(Pat1_CITE.c[["H1.H2"]][,1], k = 2)
number of iterations= 26 
data.frame(x = mixmd2$x)%>%
  ggplot() +
  geom_histogram(aes(x, ..density..), binwidth = 0.01, colour = "black", 
                 fill = "white") +  ylab("Density") +geom_vline (xintercept = 0.15)

post.df <- as.data.frame(cbind(x = mixmd2$x, mixmd2$posterior))
head(post.df, 100)
              x        comp.1    comp.2
1   -0.24952714  7.475855e-01 0.2524145
2    0.59325213  2.119813e-06 0.9999979
3   -0.40265809  8.233979e-01 0.1766021
4   -0.50418790  8.147899e-01 0.1852101
5   -0.14986917  6.084293e-01 0.3915707
6   -0.16001123  6.269059e-01 0.3730941
7   -2.49369689  1.163713e-25 1.0000000
8   -1.64966567  5.574524e-09 1.0000000
9   -0.71390649  6.118769e-01 0.3881231
10  -0.73381256  5.730588e-01 0.4269412
11  -0.81303032  3.882069e-01 0.6117931
12  -0.79040474  4.444555e-01 0.5555445
13  -0.36868700  8.168388e-01 0.1831612
14  -1.08679220  1.230332e-02 0.9876967
15  -0.96304118  8.698854e-02 0.9130115
16  -0.33971683  8.071879e-01 0.1928121
17  -0.59364587  7.672856e-01 0.2327144
18  -0.50978874  8.130428e-01 0.1869572
19   0.90928691  6.512836e-11 1.0000000
20   0.08697600  9.985802e-02 0.9001420
21  -0.27071576  7.662715e-01 0.2337285
22  -0.48434460  8.198451e-01 0.1801549
23  -0.18890898  6.739850e-01 0.3260150
24  -0.97246964  7.649035e-02 0.9235097
25  -0.13555191  5.806367e-01 0.4193633
26   0.73517230  2.811048e-08 1.0000000
27  -1.23168867  6.696398e-04 0.9993304
28   3.07687788  2.538314e-74 1.0000000
29   0.54185450  8.837189e-06 0.9999912
30   0.53817774  9.759920e-06 0.9999902
31   0.63849572  5.677452e-07 0.9999994
32  -0.61619470  7.474940e-01 0.2525060
33  -0.03892519  3.539367e-01 0.6460633
34   0.39369948  3.590270e-04 0.9996410
35   0.71850051  4.808457e-08 1.0000000
36   0.74414945  2.098669e-08 1.0000000
37   0.59195925  2.199300e-06 0.9999978
38  -0.79834762  4.248635e-01 0.5751365
39   0.46850599  5.969536e-05 0.9999403
40  -0.57938918  7.779729e-01 0.2220271
41   0.83223184  1.059341e-09 1.0000000
42  -0.25979058  7.570450e-01 0.2429550
43  -0.12203155  5.526181e-01 0.4473819
44  -0.43974670  8.251299e-01 0.1748701
45  -0.43351386  8.252252e-01 0.1747748
46   0.29511821  3.005476e-03 0.9969945
47  -2.30989394  2.691358e-21 1.0000000
48  -0.29203857  7.819446e-01 0.2180554
49   0.90529214  7.556585e-11 1.0000000
50  -0.52082631  8.091694e-01 0.1908306
51   0.91448284  5.364338e-11 1.0000000
52  -1.39321218  1.296557e-05 0.9999870
53  -0.78029919  4.689952e-01 0.5310048
54  -0.64220372  7.197993e-01 0.2802007
55   3.68931554 1.671542e-102 1.0000000
56  -0.26404670  7.607402e-01 0.2392598
57  -0.25968834  7.569546e-01 0.2430454
58  -0.36850507  8.167902e-01 0.1832098
59  -0.55599225  7.927389e-01 0.2072611
60  -0.30035986  7.872787e-01 0.2127213
61   1.65271718  2.816214e-26 1.0000000
62  -0.50825781  8.135347e-01 0.1864653
63   0.94865248  1.470047e-11 1.0000000
64   2.57670077  1.161195e-54 1.0000000
65  -0.76773604  4.987111e-01 0.5012889
66  -0.58841309  7.713651e-01 0.2286349
67  -0.85755133  2.784040e-01 0.7215960
68  -0.91444232  1.586555e-01 0.8413445
69   0.87903906  1.985122e-10 1.0000000
70   1.05345525  2.265797e-13 1.0000000
71  -0.29007757  7.806257e-01 0.2193743
72   0.04425612  1.669251e-01 0.8330749
73  -0.94428715  1.110808e-01 0.8889192
74  -1.00120101  5.054634e-02 0.9494537
75  -1.91594722  2.578353e-13 1.0000000
76  -0.21591599  7.107519e-01 0.2892481
77  -0.20509708  6.968321e-01 0.3031679
78  -0.40760658  8.239503e-01 0.1760497
79   0.44817516  9.871955e-05 0.9999013
80   1.22190565  1.462412e-16 1.0000000
81  -0.51766649  8.103376e-01 0.1896624
82  -0.35057567  8.112683e-01 0.1887317
83  -0.39723627  8.226773e-01 0.1773227
84  -0.39713676  8.226629e-01 0.1773371
85  -0.80941256  3.972723e-01 0.6027277
86  -0.53143059  8.048906e-01 0.1951094
87   0.28377269  3.770460e-03 0.9962295
88   0.99580464  2.335763e-12 1.0000000
89  -0.47953081  8.208129e-01 0.1791871
90  -0.51188099  8.123529e-01 0.1876471
91   1.75929763  5.021009e-29 1.0000000
92  -0.30156262  7.880153e-01 0.2119847
93  -0.44995764  8.246369e-01 0.1753631
94   0.57767845  3.292526e-06 0.9999967
95  -0.40725104  8.239139e-01 0.1760861
96   3.57588399  6.080954e-97 1.0000000
97  -0.24230343  7.404462e-01 0.2595538
98  -0.21333731  7.075297e-01 0.2924703
99  -0.17787464  6.569758e-01 0.3430242
100  2.62927947  1.380705e-56 1.0000000

GMM failed due to noise, hard borders selected based on kernel and overall expression

DefaultAssay(object = Pat1_CITE.c) <- "HTO"

Pat1_CITE.c@meta.data$Sample <- 'Unknown'
Pat1_CITE.c@meta.data[WhichCells(Pat1_CITE.c, expression = H1.H2 > 0.2) ,"Sample"] <- "Pat1_R1_H1-N"
Pat1_CITE.c@meta.data[WhichCells(Pat1_CITE.c, expression = H1.H2 < 0) ,"Sample"] <- "Pat1_R1_Ven_H2-N"
Pat1_CITE.c@meta.data[WhichCells(Pat1_CITE.c, expression = `Pat1-Ven-R1-H2` >1 & `Pat1-R1-H1` >1) ,"Sample"] <- "Multi-Cell-Hashs"
Pat1_CITE.c@meta.data[WhichCells(Pat1_CITE.c, expression = `Pat1-Ven-R1-H2` <0.2 & `Pat1-R1-H1` <0.2) ,"Sample"] <- "Unlabelled"
DefaultAssay(Pat1_CITE.c) <- "RNA"
FeatureScatter(Pat1_CITE.c, feature1 = "hto_Pat1-R1-H1", feature2 = "hto_Pat1-Ven-R1-H2", group.by = "Sample") 

prop.table(table(Pat1_CITE.c@meta.data$Sample, Pat1_CITE.c@meta.data$seurat_clusters), margin = 1)*100
                  
                            0          1          2          3          4
  Multi-Cell-Hashs  7.3684211 11.0526316 57.8947368 17.8947368  0.0000000
  Pat1_R1_H1-N     32.3782235 32.2063037 13.4097421 11.5759312  4.0687679
  Pat1_R1_Ven_H2-N 39.5142180 34.5082938 10.6635071  8.0272512  2.5177725
  Unknown          37.5000000 22.9166667  2.0833333  8.3333333 18.7500000
  Unlabelled       60.0000000 20.0000000  0.0000000 20.0000000  0.0000000
                  
                            5          6          7
  Multi-Cell-Hashs  3.6842105  1.0526316  1.0526316
  Pat1_R1_H1-N      1.9484241  2.1203438  2.2922636
  Pat1_R1_Ven_H2-N  1.9549763  1.8957346  0.9182464
  Unknown           6.2500000  4.1666667  0.0000000
  Unlabelled        0.0000000  0.0000000  0.0000000
prop.table(table( Pat1_CITE.c@meta.data$seurat_clusters, Pat1_CITE.c@meta.data$Sample), margin = 1)*100
   
    Multi-Cell-Hashs Pat1_R1_H1-N Pat1_R1_Ven_H2-N     Unknown  Unlabelled
  0       0.72388831  29.21406412      68.97621510  0.93071355  0.15511892
  1       1.19318182  31.93181818      66.19318182  0.62500000  0.05681818
  2      15.60283688  33.19148936      51.06382979  0.14184397  0.00000000
  3       6.64062500  39.45312500      52.92968750  0.78125000  0.19531250
  4       0.00000000  43.03030303      51.51515152  5.45454545  0.00000000
  5       6.36363636  30.90909091      60.00000000  2.72727273  0.00000000
  6       1.90476190  35.23809524      60.95238095  1.90476190  0.00000000
  7       2.73972603  54.79452055      42.46575342  0.00000000  0.00000000
table(Pat1_CITE.c@meta.data$Sample)

Multi-Cell-Hashs     Pat1_R1_H1-N Pat1_R1_Ven_H2-N          Unknown 
             190             1745             3376               48 
      Unlabelled 
               5 

Reprocessing purified dataset (Just Pat1)

DefaultAssay(Pat1_CITE.c) <- "RNA"
Pat1_CITE.c<- NormalizeData(Pat1_CITE.c)
Pat1_CITE.c<- FindVariableFeatures(Pat1_CITE.c)
Pat1_CITE.c<- ScaleData(Pat1_CITE.c)
Centering and scaling data matrix
Pat1_CITE.c<- RunPCA(Pat1_CITE.c)
PC_ 1 
Positive:  SLC7A11, THBS1, FTH1, ANXA5, C15orf48, FCER1G, MS4A7, EPB41L3, NEAT1, CD14 
       CYBB, MMP14, PLA2G7, PLAUR, SH3BP5, CD93, S100A9, SOD2, KYNU, PILRA 
       IER3, SERPINB2, HNMT, CTB-61M7.2, MPEG1, CXCL16, VCAN, NCF2, S100A10, MAFB 
Negative:  RPL35, RPS2, NPM1, PTMA, LDHB, NME1, HSPE1, HSPD1, NCL, SRM 
       RANBP1, SNRPD1, NHP2, DUT, C1QBP, RAN, PA2G4, DCTPP1, PAICS, TYMS 
       PRSS57, SERBP1, PPA1, HSP90AB1, KIAA0101, GGCT, HNRNPA1, TUBA1B, SNRPE, PRKDC 
PC_ 2 
Positive:  ZFAS1, MALAT1, TSC22D1, TFPI, EPB41L4A-AS1, IL11, DDIT3, NEU4, SNHG12, DDIT4 
       PPFIBP1, INHBA, BTG1, MEF2C, DDAH2, CLK1, SQSTM1, H3F3B, MTSS1, ZEB1 
       KDM6B, SMAD3, PPP1R15A, RSRC2, NR4A3, CREBRF, CHST7, RBKS, PHLDA1, USP53 
Negative:  ACTB, PFN1, TIMP1, CYP1B1, FCER1G, LGALS1, SLC44A1, COTL1, DNMT1, QSOX1 
       LST1, ALOX5AP, TYROBP, HSPA8, CAPG, PLA2G7, EPB41L3, ARPC5, TPI1, NCF2 
       RAB31, ITGB2, CD93, CYBB, NCF1, AIF1, SRGN, S100A9, MPEG1, CD14 
PC_ 3 
Positive:  PHLDA1, INHBA, IL11, CXCL3, NAMPT, NEU4, TSC22D1, CXCL2, ATP2B1, PPP1R15A 
       BTG3, SAT1, H3F3B, DDIT3, RSRC2, IL8, BTG1, HMGA1, CTNNAL1, FOSL2 
       JUN, CXCL1, IL24, SQSTM1, KDM6B, LINC00936, NRIP3, DUSP1, CHST7, ATF3 
Negative:  PYCARD, ARHGDIB, CD74, HLA-DRB1, HLA-DRA, HLA-DMA, GSN, HLA-DPB1, AMICA1, TYROBP 
       S100A4, ACTB, TMSB10, HLA-DPA1, DOK2, HLA-DQB1, SORL1, C10orf54, LST1, CST3 
       PFN1, HCST, S100A6, HLA-DMB, CD52, CKLF, LGALS1, ENG, AIF1, LTB 
PC_ 4 
Positive:  GIMAP7, CD3D, CD2, CXCR4, SPOCK2, GIMAP4, CD3E, CD7, CD3G, PIK3IP1 
       ETS1, SYNE2, CD247, CD48, LCK, GIMAP1, SELL, CAMK4, SESN3, PRDX2 
       CLEC2D, GZMM, RARRES3, IL7R, PASK, TMSB4X, RORA, CCR7, ARL4C, PDCD4 
Negative:  PPFIBP1, MEF2C, TXN, FTL, TNFRSF4, SERPINB1, PRDX1, SQSTM1, HSP90AB1, IL8 
       TFPI, HIST2H2AA3, CKLF, HMGA1, HLA-DRA, AGPAT9, HLA-DRB1, H2AFY, SAT1, AHR 
       ZFAS1, PPP1R15A, LMNA, MIR155HG, TPM4, MTSS1, SQLE, CD74, NFKB1, GSN 
PC_ 5 
Positive:  IL6, CCL20, CXCL5, IL1A, CCL4, CXCL1, GATA2, PTGS2, IL1B, CCL3 
       RNF144B, MARCKS, MT1M, AQP9, G0S2, MT1G, MT2A, PPBP, TNFAIP6, TNIP3 
       SERPINB2, EREG, RP11-701P16.5, C1QTNF1, PRSS57, SLC7A7, AC003092.1, MT1E, MET, IL1R1 
Negative:  FGL2, LMNA, SAMHD1, TSC22D1, IL11, CD180, CTNNAL1, AGPAT9, PAK1, CKLF 
       FTL, CD300LB, DDIT3, ENPP2, RUNX3, RGCC, SLC8A1, FPR3, STK17B, NRIP3 
       RSRC2, C10orf54, CD36, JUN, NQO1, CCR1, H2AFZ, HMGA1, PKIB, PTPN22 
ElbowPlot(Pat1_CITE.c, ndims = 50)

Only sample

Pat1_CITE.only <- subset(Pat1_CITE.c, subset = Sample == "Pat1_R1_H1-N" | Sample == "Pat1_R1_Ven_H2-N")
table(Pat1_CITE.only@meta.data$Sample)

    Pat1_R1_H1-N Pat1_R1_Ven_H2-N 
            1745             3376 
DefaultAssay(Pat1_CITE.only) <- "RNA"
Pat1_CITE.only<- NormalizeData(Pat1_CITE.only)
Pat1_CITE.only<- FindVariableFeatures(Pat1_CITE.only)
Pat1_CITE.only<- ScaleData(Pat1_CITE.only)
Centering and scaling data matrix
Pat1_CITE.only<- RunPCA(Pat1_CITE.only)
PC_ 1 
Positive:  RPL35, RPS2, NPM1, PTMA, RPL12, NME1, HSPE1, LDHB, HSPD1, NCL 
       SRM, RANBP1, SNRPD1, DUT, NHP2, C1QBP, RAN, TYMS, PA2G4, DCTPP1 
       PAICS, PRSS57, SERBP1, KIAA0101, PPA1, HSP90AB1, TUBA1B, GGCT, HNRNPA1, PRKDC 
Negative:  SLC7A11, THBS1, FTH1, ANXA5, C15orf48, NEAT1, MS4A7, FCER1G, EPB41L3, CD14 
       CYBB, MMP14, PLA2G7, PLAUR, SH3BP5, KYNU, IER3, SOD2, CD93, S100A9 
       PILRA, SERPINB2, CTB-61M7.2, CXCL16, HNMT, MPEG1, VCAN, NCF2, IL8, MAFB 
PC_ 2 
Positive:  ACTB, PFN1, TIMP1, FCER1G, CYP1B1, LGALS1, SLC44A1, COTL1, ALOX5AP, PLA2G7 
       QSOX1, EPB41L3, CAPG, TYROBP, LST1, DNMT1, ARPC5, NCF2, CD93, HSPA8 
       RAB31, CYBB, TPI1, ITGB2, NCF1, S100A9, AIF1, CD14, MPEG1, MMP14 
Negative:  ZFAS1, MALAT1, TSC22D1, TFPI, EPB41L4A-AS1, IL11, DDIT3, NEU4, SNHG12, DDIT4 
       PPFIBP1, INHBA, MEF2C, BTG1, DDAH2, CLK1, MTSS1, SQSTM1, ZEB1, H3F3B 
       SMAD3, KDM6B, PPP1R15A, NR4A3, RSRC2, CREBRF, CHST7, AKIRIN2, RBKS, PHLDA1 
PC_ 3 
Positive:  PYCARD, ARHGDIB, CD74, HLA-DRB1, HLA-DRA, HLA-DMA, HLA-DPB1, GSN, TYROBP, AMICA1 
       S100A4, TMSB10, ACTB, HLA-DPA1, DOK2, SORL1, HLA-DQB1, CD52, C10orf54, LST1 
       HCST, CST3, S100A6, HLA-DMB, PFN1, CKLF, LTB, AIF1, LGALS1, ENG 
Negative:  PHLDA1, IL11, INHBA, CXCL3, NEU4, TSC22D1, NAMPT, CXCL2, PPP1R15A, ATP2B1 
       SAT1, BTG3, H3F3B, DDIT3, RSRC2, IL8, HMGA1, BTG1, CTNNAL1, FOSL2 
       JUN, SQSTM1, KDM6B, IL24, CXCL1, LINC00936, NRIP3, DUSP1, CHST7, ATF3 
PC_ 4 
Positive:  GIMAP7, CD3D, CD2, CXCR4, SPOCK2, GIMAP4, CD3E, CD3G, CD7, PIK3IP1 
       SYNE2, ETS1, CD247, CD48, LCK, GIMAP1, CAMK4, SELL, PRDX2, SESN3 
       GZMM, RARRES3, PASK, IL7R, TMSB4X, RORA, ARL4C, SLFN5, CLIC3, CCR7 
Negative:  PPFIBP1, MEF2C, TXN, TNFRSF4, FTL, SERPINB1, PRDX1, HSP90AB1, SQSTM1, CKLF 
       IL8, HLA-DRA, HLA-DRB1, TFPI, AGPAT9, HIST2H2AA3, HMGA1, TPM4, AHR, GSN 
       LMNA, ZFAS1, CD74, HLA-DMA, SAT1, SQLE, PFN1, PYCARD, MIR155HG, SYNJ2 
PC_ 5 
Positive:  FGL2, LMNA, SAMHD1, TSC22D1, IL11, CD180, CKLF, PAK1, AGPAT9, CTNNAL1 
       RUNX3, CD300LB, ENPP2, SLC8A1, FTL, RGCC, DDIT3, C10orf54, FPR3, STK17B 
       CCR1, NQO1, NRIP3, IFI16, JUN, CD36, H2AFZ, PTPN22, RSRC2, GLIPR1 
Negative:  IL6, CCL20, CXCL5, IL1A, CCL4, GATA2, CXCL1, IL1B, CCL3, PTGS2 
       RNF144B, MT1M, MARCKS, AQP9, G0S2, MT1G, MT2A, TNFAIP6, TNIP3, PPBP 
       SERPINB2, EREG, RP11-701P16.5, C1QTNF1, PRSS57, MET, AC003092.1, IL1R1, MT1E, SLC7A7 
ElbowPlot(Pat1_CITE.only, ndims = 50)

Pat1_CITE.only <- RunUMAP(Pat1_CITE.only, dims = 1:25)
Warning: The default method for RunUMAP has changed from calling Python UMAP via reticulate to the R-native UWOT using the cosine metric
To use Python UMAP via reticulate, set umap.method to 'umap-learn' and metric to 'correlation'
This message will be shown once per session
13:36:09 UMAP embedding parameters a = 0.9922 b = 1.112
13:36:09 Read 5121 rows and found 25 numeric columns
13:36:09 Using Annoy for neighbor search, n_neighbors = 30
13:36:09 Building Annoy index with metric = cosine, n_trees = 50
0%   10   20   30   40   50   60   70   80   90   100%
[----|----|----|----|----|----|----|----|----|----|
**************************************************|
13:36:11 Writing NN index file to temp file /tmp/RtmpnfykTG/file28f9c2c8846cb
13:36:11 Searching Annoy index using 1 thread, search_k = 3000
13:36:12 Annoy recall = 100%
13:36:13 Commencing smooth kNN distance calibration using 1 thread
13:36:13 Initializing from normalized Laplacian + noise
13:36:14 Commencing optimization for 500 epochs, with 208674 positive edges
13:36:33 Optimization finished
Pat1_CITE.only <- RunTSNE(Pat1_CITE.only, dims = 1:25)
Pat1_CITE.only <- FindNeighbors(Pat1_CITE.only, dims = 1:25)
Computing nearest neighbor graph
Computing SNN
Pat1_CITE.only <- FindClusters(Pat1_CITE.only, resolution = 0.1,algorithm = 3, random.seed = 19950927)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 5121
Number of edges: 179877

Running smart local moving algorithm...
Maximum modularity in 10 random starts: 0.9552
Number of communities: 6
Elapsed time: 3 seconds
Pat1_CITE.only@meta.data$RNA_cluster_0.1 <- Pat1_CITE.only@active.ident
prop.table(table(Pat1_CITE.only@meta.data$Sample, Pat1_CITE.only@meta.data$RNA_cluster_0.1), margin = 1)*100
                  
                            0          1          2          3          4
  Pat1_R1_H1-N     39.1977077 28.9398281 10.3724928 13.5816619  7.4498567
  Pat1_R1_Ven_H2-N 47.5710900 23.9040284 13.0331754  9.1528436  5.7464455
                  
                            5
  Pat1_R1_H1-N      0.4584527
  Pat1_R1_Ven_H2-N  0.5924171
DimPlot(Pat1_CITE.only, reduction = "tsne", group.by="RNA_cluster_0.1", label = TRUE, label.size=10, pt.size = 0.5) + NoLegend()

DimPlot(Pat1_CITE.only, reduction = "umap", group.by="RNA_cluster_0.1", label = TRUE, label.size=10, pt.size = 0.5) + NoLegend()

Pat1_CITE.only <- FindClusters(Pat1_CITE.only, resolution = 0.5,algorithm = 3, random.seed = 19950927)
Modularity Optimizer version 1.3.0 by Ludo Waltman and Nees Jan van Eck

Number of nodes: 5121
Number of edges: 179877

Running smart local moving algorithm...
Maximum modularity in 10 random starts: 0.8741
Number of communities: 10
Elapsed time: 2 seconds
Pat1_CITE.only@meta.data$RNA_cluster <- Pat1_CITE.only@active.ident
prop.table(table(Pat1_CITE.only@meta.data$Sample, Pat1_CITE.only@meta.data$RNA_cluster), margin = 1)*100
                  
                            0          1          2          3          4
  Pat1_R1_H1-N     20.2292264 25.7306590  9.8567335 10.4297994 13.4670487
  Pat1_R1_Ven_H2-N 24.8518957 21.7120853 16.3803318 13.1220379  9.0639810
                  
                            5          6          7          8          9
  Pat1_R1_H1-N     10.2578797  6.0171920  2.1203438  1.4326648  0.4584527
  Pat1_R1_Ven_H2-N  7.4348341  4.5023697  1.0959716  1.2440758  0.5924171
DimPlot(Pat1_CITE.only, reduction = "tsne", group.by="RNA_cluster", label = TRUE, label.size=10, pt.size = 0.5) + NoLegend()

DimPlot(Pat1_CITE.only, reduction = "umap", group.by="RNA_cluster", label = TRUE, label.size=10, pt.size = 0.5) + NoLegend()

Annotation with ConbAC

new.cluster.ids <- c("Leukemia cells (HSPC-alike)", "Leukemia cells (Monocytic progenitor-alike)", "Leukemia cells (stem cells)", "Leukemia cells (diffuse – Lymphocytes/Megakaryocyte patterns)", "Monocytes (and cDCs)",   "Leukemia cells (Monocytic alike)", "Lymphocytes (CD4 T-Cell dominant)","Leukemia cells (stem cells 2)", "NK cells (and T-cells)", "Unknown (cDC dominant)")
names(new.cluster.ids) <- levels(Pat1_CITE.only)
Pat1_CITE.only <- RenameIdents(Pat1_CITE.only, new.cluster.ids)
Pat1_CITE.only@meta.data$celltype <- Pat1_CITE.only@active.ident
new.cluster.ids <- c("Leukemia (HSPC)", "Leukemia (Mon prog)", "Leukemia (stem)", "Leukemia (diff)", "Monocytes",   "Leukemia (Mon)", "Lymphocytes","Leukemia (stem 2)", "NK cells", "Unknown")
names(new.cluster.ids) <- levels(Pat1_CITE.only)
Pat1_CITE.only <- RenameIdents(Pat1_CITE.only, new.cluster.ids)
prop.table(table(Pat1_CITE.only@meta.data$Sample, Pat1_CITE.only@meta.data$celltype), margin = 1)*100
                  
                   Leukemia cells (HSPC-alike)
  Pat1_R1_H1-N                      20.2292264
  Pat1_R1_Ven_H2-N                  24.8518957
                  
                   Leukemia cells (Monocytic progenitor-alike)
  Pat1_R1_H1-N                                      25.7306590
  Pat1_R1_Ven_H2-N                                  21.7120853
                  
                   Leukemia cells (stem cells)
  Pat1_R1_H1-N                       9.8567335
  Pat1_R1_Ven_H2-N                  16.3803318
                  
                   Leukemia cells (diffuse – Lymphocytes/Megakaryocyte patterns)
  Pat1_R1_H1-N                                                        10.4297994
  Pat1_R1_Ven_H2-N                                                    13.1220379
                  
                   Monocytes (and cDCs) Leukemia cells (Monocytic alike)
  Pat1_R1_H1-N               13.4670487                       10.2578797
  Pat1_R1_Ven_H2-N            9.0639810                        7.4348341
                  
                   Lymphocytes (CD4 T-Cell dominant)
  Pat1_R1_H1-N                             6.0171920
  Pat1_R1_Ven_H2-N                         4.5023697
                  
                   Leukemia cells (stem cells 2) NK cells (and T-cells)
  Pat1_R1_H1-N                         2.1203438              1.4326648
  Pat1_R1_Ven_H2-N                     1.0959716              1.2440758
                  
                   Unknown (cDC dominant)
  Pat1_R1_H1-N                  0.4584527
  Pat1_R1_Ven_H2-N              0.5924171
DimPlot(Pat1_CITE.only, reduction = "tsne", group.by="celltype", label = TRUE, label.size=4, pt.size = 0.5) + NoLegend()

DimPlot(Pat1_CITE.only, reduction = "umap", group.by="celltype", label = TRUE, label.size=4, pt.size = 0.5) + NoLegend()

DimPlot(Pat1_CITE.only, reduction = "umap", group.by="celltype", label = TRUE, label.size=4, pt.size = 0.5) + theme(legend.position="bottom")

##CITE Antibodies

VlnPlot(Pat1_CITE.only, assay= "Epi", features = c("CD19","CD3","CD16","CD4","CD11c","CD56-NCAM","CD14","CD8","CD45","CD34","CD15","unmapped" ), ncol = 6, pt.size = 0.1,group.by ="Sample" ) + NoLegend()
Warning in FetchData(object = object, vars = features, slot = slot): The
following requested variables were not found: unmapped

FeaturePlot(Pat1_CITE.only, features = c("epi_CD19","CD3","CD16","epi_CD4","CD11c","CD56-NCAM","epi_CD14","CD8","CD45","CD34","CD15","unmapped" ))
Warning: Could not find CD3 in the default search locations, found in Epi assay
instead
Warning: Could not find CD16 in the default search locations, found in Epi assay
instead
Warning: Could not find CD11c in the default search locations, found in Epi
assay instead
Warning: Could not find CD56-NCAM in the default search locations, found in Epi
assay instead
Warning: Could not find CD8 in the default search locations, found in Epi assay
instead
Warning: Could not find CD45 in the default search locations, found in Epi assay
instead
Warning: Could not find CD34 in the default search locations, found in Epi assay
instead
Warning: Could not find CD15 in the default search locations, found in Epi assay
instead
Warning in FetchData(object = object, vars = c(dims, "ident", features), : The
following requested variables were not found: unmapped

VlnPlot(Pat1_CITE.only, assay= "Epi", features = c("CD19","CD16","CD56-NCAM","CD8","CD34","unmapped"), ncol = 3, pt.size = 0.1) + NoLegend()
Warning in FetchData(object = object, vars = features, slot = slot): The
following requested variables were not found: unmapped

VlnPlot(Pat1_CITE.only, assay= "Epi", features = c("CD3","CD4","CD11c","CD14","CD45","CD15"), ncol = 3, pt.size = 0.1) + NoLegend()

RidgePlot(Pat1_CITE.only, assay = "Epi", features = c("CD3","CD14","CD16","CD4", "CD11c","CD56-NCAM"), ncol = 3) + NoLegend()
Picking joint bandwidth of 0.136
Picking joint bandwidth of 0.119
Picking joint bandwidth of 0.151
Picking joint bandwidth of 0.103
Picking joint bandwidth of 0.111
Picking joint bandwidth of 0.11

RidgePlot(Pat1_CITE.only, assay = "Epi", features = c("CD45","CD15", "CD8","CD34", "CD19"), ncol = 3) + NoLegend()
Picking joint bandwidth of 0.103
Picking joint bandwidth of 0.0875
Picking joint bandwidth of 0.191
Picking joint bandwidth of 0.0875
Picking joint bandwidth of 0.123

FeatureScatter(Pat1_CITE.only, feature1 = "epi_CD15", feature2 = "epi_CD11c") 

FeatureScatter(Pat1_CITE.only, feature1 = "epi_CD15", feature2 = "epi_CD34") 

FeatureScatter(Pat1_CITE.only, feature1 = "epi_CD34", feature2 = "epi_CD11c")

saveRDS(Pat1_CITE.only, file = "./Pat1_CITE_integrated.rds")